-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NUKE leftover CPU lightGrid code, minor fixes and cleanup #1496
NUKE leftover CPU lightGrid code, minor fixes and cleanup #1496
Conversation
28a73d5
to
49d98ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it WFY, LGTM.
Speaking of alternate lightgrid code, @VReaperV do you think it's technically doable to have a “lowest” lightgrid implementation (only meaningful for models), that would just sample the lightgrid color at the origin of the model (CPU side), and uniformly lit the whole model with that color (probably using the rgbgen fields), skipping entirely the lightgrid GLSL, relying on the fullbright GLSL code? |
Yeah, that would be easily doable. In fact, particles and trails already do pretty much that (but they interpolate between a few points) - which is kinda stupid, because it actually involves an IPC round-trip for no reason... |
{ | ||
sscanf( value, "%f %f %f", &tr.worldEntity.ambientLight[ 0 ], &tr.worldEntity.ambientLight[ 1 ], | ||
&tr.worldEntity.ambientLight[ 2 ] ); | ||
if ( r_forceAmbient.Get() == 0 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If r_forceAmbient
is overriding some value specified by the BSP, shouldn't the cvar be off by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps. I just used the value that was already there for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also the issue that there could be maps relying on it.
Just as an ugly and cheap alternative for the “lowest” preset that would not be a cheat, because the model would still be dark in a dark room and lit in a lit room. It would save on GLSL processing and on GPU memory, and not involve 3D textures in GPU memory. Just a cheap alternative that would not be a cheat. |
We do this in GLSL now, and the results of this code are not actually used for anything.
These will now actually modify the lightGrid.
49d98ef
to
c6d6122
Compare
(rebased) |
I'm merging it as is, if there are further concerns for the default value of |
You might be able to just use Daemon/src/engine/renderer/tr_light.cpp Line 188 in 5a071e2
Interpolating probably shouldn't be too much of an issue? If it is, just simply getting the closest point can be done easily enough. |
r_forceAmbient
(hopefully) work by actually using it with the GLSL lightGrid.r_forceAmbient
andr_ambientScale
changed to new-style cvars, +some cleanup.